package com.bestcem.xm.member.enums;

import com.bestcem.xm.common.core.enums.CommonEnum;

/**
 * 联系人状态
 *
 * @author yf.wang <yf.wang@idiaoyan.com>
 * @version V1.0
 * @date 2021/7/16
 */
public enum NewMemberStatusEnum implements CommonEnum {

    /**
     * 活动的
     */
    MEMBER_STATUS_ACTIVATED("活动的", 0),

    /**
     * 禁用的
     */
    MEMBER_STATUS_INACTIVATED("禁用的", 1),

    /**
     * 注销的
     */
    MEMBER_STATUS_DELETED("注销的", 2),

    /**
     * 隐藏的
     */
    MEMBER_STATUS_HIDDEN("隐藏的", 3),

    /**
     * 软删除
     */
    MEMBER_STATUS_SOFT_DELETE("软删除", 4);

    private String name;

    private int index;

    NewMemberStatusEnum(String name, int index) {
        this.name = name;
        this.index = index;
    }

    @Override
    public int getIndex() {
        return index;
    }

    @Override
    public String getName() {
        return name;
    }

    public static NewMemberStatusEnum getByIndex(int index) {
        NewMemberStatusEnum[] values = NewMemberStatusEnum.values();
        for (NewMemberStatusEnum value : values) {
            if (value.getIndex() == index) {
                return value;
            }
        }
        return null;
    }
}
